home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / printer / printrnf.sit / PrinterInfo Doc < prev    next >
Encoding:
Text File  |  1990-12-19  |  4.0 KB  |  45 lines  |  [TEXT/ttxt]

  1. PRINTERINFO 1.1
  2.  
  3. by Thomas Okken
  4.  
  5. Ñ For whom is it?
  6.  
  7. PrinterInfo is a utility for people developing applications that use the Printing Manager, and in general for people interested in what happens behind the scenes when printing with a Macintosh printer driver.
  8.  
  9. Ñ What does it do?
  10.  
  11. PrinterInfo is a utility to show you the capabilities of a printer driver, as it reports them to an application. You can set up printing parameters using the standard Page Setup and Print dialogs, and PrinterInfo will show you the contents of the print record as the driver sets it up.
  12. This can be useful if you are developing an application that has to print, and you have trouble getting the desired resolution, or page size, or printing method, out of your printer. I have found it very useful: to get an idea about the lies that buggy printer drivers tell an application, causing the application to absolutely refuse to print 300 dpi on a laser printer, for example.
  13. All fields of the PREC, except a few very obscure and totally undocumented ones, are shown in plain text and understandable units. This is useful if you want to check exactly what paper size and printable area the printer assumes for a particular page setup. Measures are shown in pixels, inches or dpi, as appropriate.
  14. For printer drivers that support PrGeneral, PrinterInfo can display all discrete resolutions and all continuous resolution ranges that are available.
  15.  
  16. Ñ How does it work?
  17.  
  18. When you start PrinterInfo, a scrollable text window is opened, which displays 25 lines of 80 columns. Text is stored in a 300-line buffer. When the maximum number of lines is reached, lines are lost off the top of the buffer. The contents of the buffer can be Copied, Cut and Cleared in the normal manner using the Edit menu. Paste and Undo are not supported.
  19. -PrGeneral
  20. When you choose this item, PrinterInfo issues a PrGeneral call with "getRslDataOp" as operation selector. The driver responds, if it supports PrGeneral, with a list of resolutions it can handle, and possibly one or more lists of resolution ranges. If you are developing an application that prints bitmaps with PrGeneral, this is useful to give you an idea about what resolutions to expect, and what resolutions you might consider supporting explicitly.
  21. -PrStlDialog
  22. This calls PrStlDialog, which brings up the driver's standard Page Setup dialog. When PrinterInfo is launched, it initializes the print record with PrDefault, so all settings are at their default values. When you accept the dialog by clicking OK, the entire print record will be dumped. You can use this to examine the effects that various page setup settings have on the fields in the print record. This can save a whole lot of work trying to find out what fields to manipulate in order to change the default settings - for example: you can use this to find out what bit you should set in order to force "Square Pixels" (called "Tall Adjusted" on the ImageWriter).
  23. -PrJobDialog
  24. This is just like the previous, except it brings up the standard Print dialog. As with PrStlDialog, the entire print record is dumped.
  25. -Save Report
  26. Save the contents of the text window to a TEXT file.
  27.  
  28. Ñ Credits
  29.  
  30. I got the information for understanding the print records etc. from Inside Mac II and V, the Printing Manager chapters. Some additional information can be found by inspecting the Printing.h header file, where all fields of the print record and its subrecords are documented, or at least named.
  31. I wrote PrinterInfo using MPW C 3.0. It runs on any Mac except 64K ROM models. System 4.1 or later is required. It should run under A/UX, but as I have not been able to test this, the "32-bit compatible" field in the SIZE resource is not set.
  32.  
  33. Ñ That's all there is to it!
  34.  
  35. Well, I hope some of you might find this useful. I know I did, that's why I took the throuble to write it! If you do find it useful, remember to smile. You know, :-)
  36. If you have questions or comments on PrinterInfo, you can try e-mail:
  37.  
  38. thomas@duteca.et.tudelft.nl
  39.  
  40. Or snail mail:
  41.  
  42. Thomas Okken
  43. Marie Curieweg 40
  44. 3731 CH  De Bilt
  45. Netherlands